resource "google_project" "project" {
	project_id = "<%= ctx[:vars]['project_id'] %>"
	name       = "<%= ctx[:vars]['project_id'] %>"
	org_id     = "<%= ctx[:test_env_vars]['org_id'] %>"
}

resource "google_tags_tag_key" "key" {
	parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>"
	short_name = "<%= ctx[:vars]['key_short_name'] %>"
	description = "For <%= ctx[:vars]['key_short_name'] %> resources."
}

resource "google_tags_tag_value" "value" {
	parent = "tagKeys/${google_tags_tag_key.key.name}"
	short_name = "<%= ctx[:vars]['value_short_name'] %>"
	description = "For <%= ctx[:vars]['value_short_name'] %> resources."
}

resource "google_tags_tag_binding" "<%= ctx[:primary_resource_id] %>" {
	parent = "//cloudresourcemanager.googleapis.com/projects/${google_project.project.number}"
	tag_value = "tagValues/${google_tags_tag_value.value.name}"
}
